how to read and print elements of array in c